<template>
  <div>
    <h2>{{ name }}</h2>
    <h2>{{ age }}</h2>
    <h2>{{ className }}</h2>
  </div>
</template>

<script>
export default {
  name: "MyChild.vue",
  props:{
    cname:String
  },
  data(){
    return{
      name:'谭磊',
      age:23,
      className:''
    }
  },
  mounted() {
    this.className = this.cname
  }
}
</script>